public class MultiplyCode {
    //print mutiply oral list from 1 ~ 9
    public static void main(String[] args){
        //the first way
        int k = 0;
        System.out.println("This is my own way that :");
        for(int i=1;i<10;i++){
            for(int j=1;j<i+1;j++){
                k = i*j;
                System.out.printf("%d*%d=%d    ",j,i,k);
            }
            System.out.println("");
        }

        //分割线
        System.out.println("");
        System.out.println("*******************************");
        System.out.println("");

        //the second way
        MultiplyCode mul = new MultiplyCode();
        mul.multiply();
    }

    //build the tool of mutiply
    public void multiply(){
        System.out.println("The better way is that:");
        for(int i = 1; i < 10; i++){
            for(int j = 1; j < i+ 1; j++){
                System.out.print(j + "*" + i + "=" + i*j +"   ");
            }

            System.out.println("");
        }
    }
    
}